package com.cyh.testdesignpattern.singleton;

/**
 * 懒汉式（线程不安全）
 * 缺点：只能在单线程下使用
 * 结论：实际开发中不使用这种方式
 * */
public class Singleton03 {
    private static Singleton03 instance;
    private void Singleton03(){
    }
    public static Singleton03 getInstance() {
        if(instance == null) {
            instance = new Singleton03();
        }
        return instance;
    }
}
